/**
 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.omn.listazakupow.db.service.base;

import com.liferay.counter.service.CounterLocalService;

import com.liferay.portal.kernel.annotation.BeanReference;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.service.ResourceLocalService;
import com.liferay.portal.service.ResourceService;
import com.liferay.portal.service.UserLocalService;
import com.liferay.portal.service.UserService;
import com.liferay.portal.service.persistence.ResourcePersistence;
import com.liferay.portal.service.persistence.UserPersistence;

import com.omn.listazakupow.db.model.ListaZakupow;
import com.omn.listazakupow.db.service.GrupyTowarowLocalService;
import com.omn.listazakupow.db.service.ListaZakupowLocalService;
import com.omn.listazakupow.db.service.PozycjeListyZakupowLocalService;
import com.omn.listazakupow.db.service.persistence.GrupyTowarowPersistence;
import com.omn.listazakupow.db.service.persistence.ListaZakupowPersistence;
import com.omn.listazakupow.db.service.persistence.PozycjeListyZakupowPersistence;

import java.util.List;

import javax.sql.DataSource;

/**
 * The base implementation of the lista zakupow local service.
 *
 * <p>
 * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.omn.listazakupow.db.service.impl.ListaZakupowLocalServiceImpl}.
 * </p>
 *
 * <p>
 * Never modify or reference this class directly. Always use {@link com.omn.listazakupow.db.service.ListaZakupowLocalServiceUtil} to access the lista zakupow local service.
 * </p>
 *
 * @author Brian Wing Shun Chan
 * @see com.omn.listazakupow.db.service.impl.ListaZakupowLocalServiceImpl
 * @see com.omn.listazakupow.db.service.ListaZakupowLocalServiceUtil
 * @generated
 */
public abstract class ListaZakupowLocalServiceBaseImpl
	implements ListaZakupowLocalService {
	/**
	 * Adds the lista zakupow to the database. Also notifies the appropriate model listeners.
	 *
	 * @param listaZakupow the lista zakupow to add
	 * @return the lista zakupow that was added
	 * @throws SystemException if a system exception occurred
	 */
	public ListaZakupow addListaZakupow(ListaZakupow listaZakupow)
		throws SystemException {
		listaZakupow.setNew(true);

		return listaZakupowPersistence.update(listaZakupow, false);
	}

	/**
	 * Creates a new lista zakupow with the primary key. Does not add the lista zakupow to the database.
	 *
	 * @param id the primary key for the new lista zakupow
	 * @return the new lista zakupow
	 */
	public ListaZakupow createListaZakupow(long id) {
		return listaZakupowPersistence.create(id);
	}

	/**
	 * Deletes the lista zakupow with the primary key from the database. Also notifies the appropriate model listeners.
	 *
	 * @param id the primary key of the lista zakupow to delete
	 * @throws PortalException if a lista zakupow with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public void deleteListaZakupow(long id)
		throws PortalException, SystemException {
		listaZakupowPersistence.remove(id);
	}

	/**
	 * Deletes the lista zakupow from the database. Also notifies the appropriate model listeners.
	 *
	 * @param listaZakupow the lista zakupow to delete
	 * @throws SystemException if a system exception occurred
	 */
	public void deleteListaZakupow(ListaZakupow listaZakupow)
		throws SystemException {
		listaZakupowPersistence.remove(listaZakupow);
	}

	/**
	 * Performs a dynamic query on the database and returns the matching rows.
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @return the matching rows
	 * @throws SystemException if a system exception occurred
	 */
	@SuppressWarnings("rawtypes")
	public List dynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return listaZakupowPersistence.findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * Performs a dynamic query on the database and returns a range of the matching rows.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @param start the lower bound of the range of model instances to return
	 * @param end the upper bound of the range of model instances to return (not inclusive)
	 * @return the range of matching rows
	 * @throws SystemException if a system exception occurred
	 */
	@SuppressWarnings("rawtypes")
	public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
		throws SystemException {
		return listaZakupowPersistence.findWithDynamicQuery(dynamicQuery,
			start, end);
	}

	/**
	 * Performs a dynamic query on the database and returns an ordered range of the matching rows.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @param start the lower bound of the range of model instances to return
	 * @param end the upper bound of the range of model instances to return (not inclusive)
	 * @param orderByComparator the comparator to order the results by
	 * @return the ordered range of matching rows
	 * @throws SystemException if a system exception occurred
	 */
	@SuppressWarnings("rawtypes")
	public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
		OrderByComparator orderByComparator) throws SystemException {
		return listaZakupowPersistence.findWithDynamicQuery(dynamicQuery,
			start, end, orderByComparator);
	}

	/**
	 * Counts the number of rows that match the dynamic query.
	 *
	 * @param dynamicQuery the dynamic query to search with
	 * @return the number of rows that match the dynamic query
	 * @throws SystemException if a system exception occurred
	 */
	public long dynamicQueryCount(DynamicQuery dynamicQuery)
		throws SystemException {
		return listaZakupowPersistence.countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * Gets the lista zakupow with the primary key.
	 *
	 * @param id the primary key of the lista zakupow to get
	 * @return the lista zakupow
	 * @throws PortalException if a lista zakupow with the primary key could not be found
	 * @throws SystemException if a system exception occurred
	 */
	public ListaZakupow getListaZakupow(long id)
		throws PortalException, SystemException {
		return listaZakupowPersistence.findByPrimaryKey(id);
	}

	/**
	 * Gets a range of all the lista zakupows.
	 *
	 * <p>
	 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	 * </p>
	 *
	 * @param start the lower bound of the range of lista zakupows to return
	 * @param end the upper bound of the range of lista zakupows to return (not inclusive)
	 * @return the range of lista zakupows
	 * @throws SystemException if a system exception occurred
	 */
	public List<ListaZakupow> getListaZakupows(int start, int end)
		throws SystemException {
		return listaZakupowPersistence.findAll(start, end);
	}

	/**
	 * Gets the number of lista zakupows.
	 *
	 * @return the number of lista zakupows
	 * @throws SystemException if a system exception occurred
	 */
	public int getListaZakupowsCount() throws SystemException {
		return listaZakupowPersistence.countAll();
	}

	/**
	 * Updates the lista zakupow in the database. Also notifies the appropriate model listeners.
	 *
	 * @param listaZakupow the lista zakupow to update
	 * @return the lista zakupow that was updated
	 * @throws SystemException if a system exception occurred
	 */
	public ListaZakupow updateListaZakupow(ListaZakupow listaZakupow)
		throws SystemException {
		listaZakupow.setNew(false);

		return listaZakupowPersistence.update(listaZakupow, true);
	}

	/**
	 * Updates the lista zakupow in the database. Also notifies the appropriate model listeners.
	 *
	 * @param listaZakupow the lista zakupow to update
	 * @param merge whether to merge the lista zakupow with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
	 * @return the lista zakupow that was updated
	 * @throws SystemException if a system exception occurred
	 */
	public ListaZakupow updateListaZakupow(ListaZakupow listaZakupow,
		boolean merge) throws SystemException {
		listaZakupow.setNew(false);

		return listaZakupowPersistence.update(listaZakupow, merge);
	}

	/**
	 * Gets the lista zakupow local service.
	 *
	 * @return the lista zakupow local service
	 */
	public ListaZakupowLocalService getListaZakupowLocalService() {
		return listaZakupowLocalService;
	}

	/**
	 * Sets the lista zakupow local service.
	 *
	 * @param listaZakupowLocalService the lista zakupow local service
	 */
	public void setListaZakupowLocalService(
		ListaZakupowLocalService listaZakupowLocalService) {
		this.listaZakupowLocalService = listaZakupowLocalService;
	}

	/**
	 * Gets the lista zakupow persistence.
	 *
	 * @return the lista zakupow persistence
	 */
	public ListaZakupowPersistence getListaZakupowPersistence() {
		return listaZakupowPersistence;
	}

	/**
	 * Sets the lista zakupow persistence.
	 *
	 * @param listaZakupowPersistence the lista zakupow persistence
	 */
	public void setListaZakupowPersistence(
		ListaZakupowPersistence listaZakupowPersistence) {
		this.listaZakupowPersistence = listaZakupowPersistence;
	}

	/**
	 * Gets the pozycje listy zakupow local service.
	 *
	 * @return the pozycje listy zakupow local service
	 */
	public PozycjeListyZakupowLocalService getPozycjeListyZakupowLocalService() {
		return pozycjeListyZakupowLocalService;
	}

	/**
	 * Sets the pozycje listy zakupow local service.
	 *
	 * @param pozycjeListyZakupowLocalService the pozycje listy zakupow local service
	 */
	public void setPozycjeListyZakupowLocalService(
		PozycjeListyZakupowLocalService pozycjeListyZakupowLocalService) {
		this.pozycjeListyZakupowLocalService = pozycjeListyZakupowLocalService;
	}

	/**
	 * Gets the pozycje listy zakupow persistence.
	 *
	 * @return the pozycje listy zakupow persistence
	 */
	public PozycjeListyZakupowPersistence getPozycjeListyZakupowPersistence() {
		return pozycjeListyZakupowPersistence;
	}

	/**
	 * Sets the pozycje listy zakupow persistence.
	 *
	 * @param pozycjeListyZakupowPersistence the pozycje listy zakupow persistence
	 */
	public void setPozycjeListyZakupowPersistence(
		PozycjeListyZakupowPersistence pozycjeListyZakupowPersistence) {
		this.pozycjeListyZakupowPersistence = pozycjeListyZakupowPersistence;
	}

	/**
	 * Gets the grupy towarow local service.
	 *
	 * @return the grupy towarow local service
	 */
	public GrupyTowarowLocalService getGrupyTowarowLocalService() {
		return grupyTowarowLocalService;
	}

	/**
	 * Sets the grupy towarow local service.
	 *
	 * @param grupyTowarowLocalService the grupy towarow local service
	 */
	public void setGrupyTowarowLocalService(
		GrupyTowarowLocalService grupyTowarowLocalService) {
		this.grupyTowarowLocalService = grupyTowarowLocalService;
	}

	/**
	 * Gets the grupy towarow persistence.
	 *
	 * @return the grupy towarow persistence
	 */
	public GrupyTowarowPersistence getGrupyTowarowPersistence() {
		return grupyTowarowPersistence;
	}

	/**
	 * Sets the grupy towarow persistence.
	 *
	 * @param grupyTowarowPersistence the grupy towarow persistence
	 */
	public void setGrupyTowarowPersistence(
		GrupyTowarowPersistence grupyTowarowPersistence) {
		this.grupyTowarowPersistence = grupyTowarowPersistence;
	}

	/**
	 * Gets the counter local service.
	 *
	 * @return the counter local service
	 */
	public CounterLocalService getCounterLocalService() {
		return counterLocalService;
	}

	/**
	 * Sets the counter local service.
	 *
	 * @param counterLocalService the counter local service
	 */
	public void setCounterLocalService(CounterLocalService counterLocalService) {
		this.counterLocalService = counterLocalService;
	}

	/**
	 * Gets the resource local service.
	 *
	 * @return the resource local service
	 */
	public ResourceLocalService getResourceLocalService() {
		return resourceLocalService;
	}

	/**
	 * Sets the resource local service.
	 *
	 * @param resourceLocalService the resource local service
	 */
	public void setResourceLocalService(
		ResourceLocalService resourceLocalService) {
		this.resourceLocalService = resourceLocalService;
	}

	/**
	 * Gets the resource remote service.
	 *
	 * @return the resource remote service
	 */
	public ResourceService getResourceService() {
		return resourceService;
	}

	/**
	 * Sets the resource remote service.
	 *
	 * @param resourceService the resource remote service
	 */
	public void setResourceService(ResourceService resourceService) {
		this.resourceService = resourceService;
	}

	/**
	 * Gets the resource persistence.
	 *
	 * @return the resource persistence
	 */
	public ResourcePersistence getResourcePersistence() {
		return resourcePersistence;
	}

	/**
	 * Sets the resource persistence.
	 *
	 * @param resourcePersistence the resource persistence
	 */
	public void setResourcePersistence(ResourcePersistence resourcePersistence) {
		this.resourcePersistence = resourcePersistence;
	}

	/**
	 * Gets the user local service.
	 *
	 * @return the user local service
	 */
	public UserLocalService getUserLocalService() {
		return userLocalService;
	}

	/**
	 * Sets the user local service.
	 *
	 * @param userLocalService the user local service
	 */
	public void setUserLocalService(UserLocalService userLocalService) {
		this.userLocalService = userLocalService;
	}

	/**
	 * Gets the user remote service.
	 *
	 * @return the user remote service
	 */
	public UserService getUserService() {
		return userService;
	}

	/**
	 * Sets the user remote service.
	 *
	 * @param userService the user remote service
	 */
	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	/**
	 * Gets the user persistence.
	 *
	 * @return the user persistence
	 */
	public UserPersistence getUserPersistence() {
		return userPersistence;
	}

	/**
	 * Sets the user persistence.
	 *
	 * @param userPersistence the user persistence
	 */
	public void setUserPersistence(UserPersistence userPersistence) {
		this.userPersistence = userPersistence;
	}

	/**
	 * Performs an SQL query.
	 *
	 * @param sql the sql query to perform
	 */
	protected void runSQL(String sql) throws SystemException {
		try {
			DataSource dataSource = listaZakupowPersistence.getDataSource();

			SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
					sql, new int[0]);

			sqlUpdate.update();
		}
		catch (Exception e) {
			throw new SystemException(e);
		}
	}

	@BeanReference(type = ListaZakupowLocalService.class)
	protected ListaZakupowLocalService listaZakupowLocalService;
	@BeanReference(type = ListaZakupowPersistence.class)
	protected ListaZakupowPersistence listaZakupowPersistence;
	@BeanReference(type = PozycjeListyZakupowLocalService.class)
	protected PozycjeListyZakupowLocalService pozycjeListyZakupowLocalService;
	@BeanReference(type = PozycjeListyZakupowPersistence.class)
	protected PozycjeListyZakupowPersistence pozycjeListyZakupowPersistence;
	@BeanReference(type = GrupyTowarowLocalService.class)
	protected GrupyTowarowLocalService grupyTowarowLocalService;
	@BeanReference(type = GrupyTowarowPersistence.class)
	protected GrupyTowarowPersistence grupyTowarowPersistence;
	@BeanReference(type = CounterLocalService.class)
	protected CounterLocalService counterLocalService;
	@BeanReference(type = ResourceLocalService.class)
	protected ResourceLocalService resourceLocalService;
	@BeanReference(type = ResourceService.class)
	protected ResourceService resourceService;
	@BeanReference(type = ResourcePersistence.class)
	protected ResourcePersistence resourcePersistence;
	@BeanReference(type = UserLocalService.class)
	protected UserLocalService userLocalService;
	@BeanReference(type = UserService.class)
	protected UserService userService;
	@BeanReference(type = UserPersistence.class)
	protected UserPersistence userPersistence;
}